Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactoring ALP #247

Merged
merged 1 commit into from
Feb 16, 2022
Merged

Refactoring ALP #247

merged 1 commit into from
Feb 16, 2022

Conversation

giuseros
Copy link
Collaborator

@giuseros giuseros commented Feb 7, 2022

This is a big refactor of our experimental codebase to follow latest developments:

  • Generate functions through the Python DSL interface
  • Use the trasnformation infra common in the sandbox
  • Generalize tuner/mlirc to be program agnostic (although transformations are still GEMM-specific)
  • Add a python transformation to save the IR
  • Make configure.py compatible with python 3.7

@giuseros
Copy link
Collaborator Author

giuseros commented Feb 7, 2022

cc @nicolasvasilache @stevenvar

Copy link
Contributor

@nicolasvasilache nicolasvasilache left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be a lot of duplication that could be trimmed down, but as per the guidelines it is not a blocker.

Changes to non aALP parts have some issues though.

configure.py Outdated Show resolved Hide resolved
experimental/alp/python/alp/backend/codegen.py Outdated Show resolved Hide resolved
else [objtype] + other_cls._transform_classes)
return TransformListMetaclass(name, (TransformationList,), {},
transforms=transforms)
"""Python descriptor dispatching `then` on the `Transform` class as either
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file has unfortunately too many trivial spacing changes that makes it hard to review more deeply.

Please note the autoformatting setup that we've been using:
https://github.com/nicolasvasilache/nicolas.vasilache.github.io/blob/master/vscode_settings/settings.json#L43

Maybe that will help you reduce the amount of changes so this load-bearing file becomes reviewable?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good to know, I was using Black and that file was reformatted like that. I will try your vscode settings. Does it apply the formatting every time you modify a python file?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, I never heard of YAPF :) Let me try it out !

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, the config I shared reformats on save

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I tried YAPF out, but that file still seems to suffer for reformatting. Should I try to add this as an independent change as well?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, pulling non-experimental changes out of this commit and having a specific reformat CL would be great, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please slice this out in a separate PR, address and rebase ?
This way we can land this bigger refactoring.

@giuseros
Copy link
Collaborator Author

@nicolasvasilache I removed the change to transform.py so that we can deal with them in parallel

@nicolasvasilache
Copy link
Contributor

@nicolasvasilache I removed the change to transform.py so that we can deal with them in parallel

Great, let's just do the same for configure.py and land this.
Alternatively, if you're not getting the same formatting, you can disable it temporarily to avoid all the github-unreviewable whitespaces.
I can format when I land.

This is a big refactor of our experimental codebase to follow latest developments:
- Generate functions through the Python DSL interface
- Use the trasnformation infra common in the sandbox
- Generalize tuner/mlirc to be program agnostic (although transformations are still GEMM-specific)
- Add a python transformation to save the IR
- Make `configure.py` compatible with python 3.7
@giuseros
Copy link
Collaborator Author

@nicolasvasilache , I think there are no more space-formatting changes around. The only change that affects the main repo is in configure.py, but it is guarded by an if args.enable_alp, so I think it should be ok (please, let me know if it isn't).

Please, let me know if there is anything else I need to change/update

@nicolasvasilache
Copy link
Contributor

it is guarded by an if args.enable_alp, so I think it should be ok (please, let me know if it isn't).

Looks good thanks!

@nicolasvasilache nicolasvasilache merged commit 1db3c8e into iree-org:main Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants